A network generally refers to computers and/or other device interconnected for data communication. A network interface controller (NIC) is a hardware device that connects a host computer system to a computer network such as a local area network (LAN). The NIC communicates with the host bus and is controlled by the host CPU in a manner similar to the way the host CPU controls an I/O device. Thus, the NIC appears as an I/O device to the host computer. To the network, the NIC can send and receive packets and appears as an attached computer.
NICs typically use descriptor rings for processing packets both in the receive direction and in the transmit direction. For example, when the NIC receives a packet or frame, the NIC reads a receive descriptor from the host system memory to determine where to place the data in the host system. After the data is moved to the host system main memory, the receive descriptor is written back out to the host system memory with status information about the received frame. In the transmit direction, the NIC operates in a similar fashion to the receive direction. In particular, the NIC is first notified by the host CPU of a new transmit. The NIC then reads the descriptor to locate the data, reads the data, and then writes the descriptor back with status about the transmit. On transmits, the NIC typically reads the next expected descriptor to see if any more data needs to be sent. As is evident, each receive or transmit frame results in at least three peripheral component interconnect (PCI) or peripheral bus reads or writes in addition to a status register read.
After the NIC receives and transfers the packet to the host computer, the host computer processes the packet through a protocol stack. During the host packet processing, the protocol header (e.g., transmission control protocol (TCP), Internet protocol (IP), Ethernet) is removed. The data portion is thus recovered and can be made available to a user, an application program, etc.
A non-insignificant amount of processing time is required for the host system to identify a TCP context due in part to memory access times. While the TCP context lookup may be offloaded to the NIC, such a mechanism requires significantly more NIC memory as well as elaborate communications between the NIC and the host to manage “statefull” memory on the NIC.